package com.song.config;

import com.song.filter.MyFilter;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.Filter;

/**
 * @ClassName : MyConfig
 * @Author : 司猫子
 * @Date: 2021/3/1 13:35
 */
@Configuration
public class MyConfig {

    @Bean
    public FilterRegistrationBean filterRegistrationBean(){
        MyFilter myFilter = new MyFilter();
        FilterRegistrationBean reg = new FilterRegistrationBean();
        reg.setFilter(myFilter);
        reg.addUrlPatterns("/nnn/*");

        return reg;
    }
}
